﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dala.Samples.BusinessLogicLayer;

namespace Dala.Samples.form_view
{
    public partial class form_view : System.Web.UI.Page
    {
        private void BindData()
        {
            fvProduct.DataSource = new ProductBLL().GetAllProducts();
            fvProduct.DataBind();
        }


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
               this.BindData();

            }
        }
        protected void fvProduct_ModeChanging(object sender, FormViewModeEventArgs e)
        {
            fvProduct.ChangeMode(e.NewMode);
            this.BindData();
        }
        protected void fvProduct_PageIndexChanging(object sender, FormViewPageEventArgs e)
        {
            fvProduct.PageIndex = e.NewPageIndex;
            this.BindData();
        }
        protected void fvProduct_ItemInserting(object sender, FormViewInsertEventArgs e)
        {
            
        }
        protected void fvProduct_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {  
        }
        protected void fvProduct_ItemDeleting(object sender, FormViewDeleteEventArgs e)
        {
            
        }

    }
}